#if 1
#include <iostream>
#include <vector>

using namespace std;

static vector<int> vector_add(const vector<int>& a, const vector<int>& b) {
    vector<int> r;
    int c = 0;
    int i = 0;
    while (i < a.size() && i < b.size()) {
        c += a[i] + b[i];
        r.push_back(c % 10);
        c /= 10;
        ++i;
    }
    while (i < a.size()) {
        c += a[i];
        r.push_back(c % 10);
        c /= 10;
        ++i;
    }
    while (i < b.size()) {
        c += b[i];
        r.push_back(c % 10);
        c /= 10;
        ++i;
    }
    if (c)
        r.push_back(c % 10);
    return r;
}

static vector<int> vector_times(const vector<int>& v, int a = 2) {
    vector<int> r;
    int c = 0;
    for (auto e : v) {
        c += 2 * e;
        r.push_back(c % 10);
        c /= 10;
    }
    if (c)
        r.push_back(c % 10);
    return r;
}

static void vector_display(const vector<int>& v) {
    for (int i = v.size() - 1; i >= 0; --i)
        cout << v[i];
}

int main() {
    int r = 0;
    vector<int> num {1};
    vector<int> den {1};
    for (int i = 0; i < 1000; ++i) {
        auto a = vector_add(vector_times(den), num);
        auto b = vector_add(num, den);
        num = a;
        den = b;
        // vector_display(a); 
        // cout << " / ";
        // vector_display(b); 
        // cout << endl;
        if (num.size() > den.size())
            ++r;
    }
    cout << r << endl;
}

#else
#include <iostream>
#include <string>
#include <numeric>

using namespace std;

static void to_common_denominator_one(uint64_t& num, uint64_t& den) {
    num += den;
    uint64_t tmp = gcd(num, den);
    num /= tmp;
    den /= tmp;
}

static void to_common_denominator_two(uint64_t& num, uint64_t& den) {
    num += 2 * den;
    uint64_t tmp = gcd(num, den);
    num /= tmp;
    den /= tmp;
}

static bool num_moredigits_than_den(int n) {
    uint64_t num = 1;
    uint64_t den = 2;
    for (uint64_t i = 1; i < n; ++i) {
        to_common_denominator_two(num, den);
        swap(num, den);
    }
    to_common_denominator_one(num, den);
    while (den) {
        num /= 10;
        den /= 10;
    }
    return num;
}

int main() {
    int s = 0;
    for (int i = 0; i < 1000; ++i) {
        if (num_moredigits_than_den(i + 1))
            ++s;
    }
    cout << s << endl;
}
#endif
